#! /bin/bash
export LANG=zh_CN.UTF-8
PRESTO_HOME=/export/server/presto/bin/presto


${PRESTO_HOME} --catalog hive --server 192.168.88.80:8090 --execute "
DROP TABLE mysql.edu_olap_online.ads_visit_consult_data_area_count;
DROP TABLE mysql.edu_olap_online.ads_visit_consult_data_count;
DROP TABLE mysql.edu_olap_online.ads_visit_consult_data_from_url_count;
DROP TABLE mysql.edu_olap_online.ads_visit_consult_data_origin_channel_count;
DROP TABLE mysql.edu_olap_online.ads_visit_consult_data_seo_source_count;
DROP TABLE mysql.edu_olap_online.ads_visit_consult_rate_count;

CREATE TABLE mysql.edu_olap_online.ads_visit_consult_data_area_count AS (
SELECT * FROM hive.edu_online_ads.ads_visit_consult_data_area_count);

CREATE TABLE mysql.edu_olap_online.ads_visit_consult_data_count AS (
SELECT * FROM hive.edu_online_ads.ads_visit_consult_data_count);

CREATE TABLE mysql.edu_olap_online.ads_visit_consult_data_from_url_count AS (
SELECT * FROM hive.edu_online_ads.ads_visit_consult_data_from_url_count);

CREATE TABLE mysql.edu_olap_online.ads_visit_consult_data_origin_channel_count AS (
SELECT * FROM hive.edu_online_ads.ads_visit_consult_data_origin_channel_count);

CREATE TABLE mysql.edu_olap_online.ads_visit_consult_data_seo_source_count AS (
SELECT * FROM hive.edu_online_ads.ads_visit_consult_data_seo_source_count);

CREATE TABLE mysql.edu_olap_online.ads_visit_consult_rate_count AS (
SELECT * FROM hive.edu_online_ads.ads_visit_consult_rate_count);
"